
public class Address {
	
	
	private int number;
	private String street;
	private String city;
	private String postCode;
	
	Address() {
		
		
		number = 0;
		street = null;
		city = null;
		postCode = null;
		
	}
	
	Address(int numberIn, String streetIn, String cityIn, String postCodeIn) throws IllegalArgumentException{
		
		number = numberIn;
		street = streetIn;
		city = cityIn;
		
		if (postCodeIn.length() > 10)
		{
			throw new IllegalArgumentException();
			
		}
		
		postCode = postCodeIn;
	}
	
	
	
	public void setNumber(int numberIn){
		
		number = numberIn;
	}
	
	public int getNumber(){
		
		return number;
	}
	
	public void setStreet(String streetIn){
		
		street = streetIn;
	}
	
	public String getStreet(){
		
		return street;
	}
	
	public void setCity(String cityIn){
		
		city = cityIn;
	}
	
	public String  getCity(){
		
		return city;
	}
	
	public void setPostCode(String postCodeIn) throws IllegalArgumentException{
		
		if (postCodeIn.length() > 10)
		{
			throw new IllegalArgumentException();
			
		}
		
		postCode = postCodeIn;
	}
	
	
	public String getPostCode(){
		
		return postCode;
	}

public boolean equals(Object object){
	
	if(object instanceof Address){
		
		Address address = (Address) object;
		
		return (getNumber() == (address.getNumber())
				&& getStreet().equals(address.getStreet())
				&& getCity().equals(address.getCity())
				&& getPostCode().equals(address.getPostCode())
				);
	}
	
	return false;
	
	
}
	
	
}
